package com.strongwell.awe.dao;

import java.util.List;
import java.util.Map;

import com.strongwell.awe.base.dao.BaseDao;
import com.strongwell.awe.model.CmsCategoryEntity;
import org.apache.ibatis.annotations.Select;

/**
 * 栏目表
 * 
 * @author bridgezn
 * @email 39440421@qq.com
 * @date 2018-09-13 22:15:42
 */
public interface CmsCategoryDao extends BaseDao<CmsCategoryEntity> {
    CmsCategoryEntity queryName(String name);
    List<CmsCategoryEntity> queryListItem(Map<String, Object> map);
    List<CmsCategoryEntity> queryNameList();

    @Select("select a.id,a.parent_id as parentId,a.name,a.del_flag as delFlag,b.content as viewConfig from cms_category a\n" +
             "left join cms_article b on b.category_id = a.id\n" +
             "where a.parent_id = (select id from cms_category where name=\"首页模块\") order by a.sort")
    List<CmsCategoryEntity> queryCategoryList();

    //@Select("select id,parent_id-1 as parentId,name,module from cms_category where id>1 and isnull(delete_time)")
    List<CmsCategoryEntity> selCategoryByParentId();
}
